'use strict';

const mongoose = require('mongoose'),
    adminModel = mongoose.model('admin');

module.exports = {
    getAdminByLogin: getAdminByLogin
}

function getAdminByLogin(admin, callback) {
    console.log(admin)
    adminModel.findOne({
        username: admin.username,
        password: admin.password
    },function(error, data){
        callback(null,data);
    });
}